﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace InsertEmoticonPlugin
{
    public partial class frmOptions : Form
    {
        Settings m_settings;
        public frmOptions(Settings settings)
        {
            InitializeComponent();
            m_settings = settings;
            chbxAutomate.Checked = m_settings.Automatic;
            chbxDefaultSize.Checked = m_settings.NonDefaultSize;
            numericUpDown1.Value = (decimal)m_settings.Size;
            
            chbxDefaultSize_CheckedChanged(this, null);
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            m_settings.Automatic = chbxAutomate.Checked;
            m_settings.NonDefaultSize = chbxDefaultSize.Checked;
            m_settings.Size = Convert.ToInt32(numericUpDown1.Value);
            this.Close();
        }

        private void chbxDefaultSize_CheckedChanged(object sender, EventArgs e)
        {
            bool yesno = chbxDefaultSize.Checked;
            label2.Enabled = yesno;
            numericUpDown1.Enabled = yesno;
            label3.Enabled = yesno;
        }
    }
}
